package BufferStream;

import java.io.*;

public class BufferStream_copy {
    public static void main(String[] args) throws IOException {
        long e = System.currentTimeMillis();
        FileInputStream fis = new FileInputStream("C:\\Users\\啦啦啦\\Desktop\\工作室后台组入门路线及介绍文档.pdf");
        //要复制的文件和文件目录
        FileOutputStream fos = new FileOutputStream("C:\\Users\\啦啦啦\\Desktop\\D.pdf");
        //复制的地点
        BufferedInputStream bis = new BufferedInputStream(fis);
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        int len=0;
        byte[] bytes = new byte[1024];
        while((len = bis.read(bytes))!=-1)
        {
            bos.write(bytes,0,len);
            //写入len个bytes字节，
        }
        bos.close();
        bis.close();
        long o = System.currentTimeMillis();
        System.out.println("耗时"+(o-e)+"ms");
    }
}
